
class auth {
    static instance = null
    constructor() {
        this.token = uni.getStorageSync('token') || ''
    }

    static getInstance() {
        if (!(this.instance instanceof this)) {
            this.instance = new this();
        }
        return this.instance;
    }

    login(url = '/pagesB/login/smsLogin') {
        if (this.token) return true
        uni.navigateTo({ url })
        return false
    }
}

export default auth.getInstance()